import Mock from 'mockjs'
import indexData from './datas/indexData.json'
import categoryList from './datas/categoryList.json'
import searchList from './datas/searchList.json'
import bannerList from './datas/banner.json'
import shopCart from './datas/shopcart.json'
import detailList from './datas/detail.json'
// 获取首页数据
Mock.mock('/mock/getIndexData', 'get', {
  code: 200,
  data: indexData,
})

// 获取三级菜单列表
/*
一级菜单:遍历cateList
二级菜单:遍历cateList中的subCateGroupList
三级菜单:遍历subCateGroupList中的categoryList
 */
Mock.mock('/mock/getCategoryList', 'get', {
  code: 200,
  data: categoryList,
})

//获取搜索页面下的展示数据
Mock.mock('/mock/getSearchList', 'get', {
  code: 200,
  data: searchList,
})

// 获取轮播图数据
Mock.mock('/mock/getBannerList', 'get', {
  code: 200,
  data: bannerList,
})


// 获取购物车列表数据
Mock.mock('/mock/shopCart', 'get', {
  code: 200,
  data: shopCart
  
})
//获取商品详情数据
Mock.mock('/mock/getDetailList','get',{
  code: 200,
  data:detailList,
})
